<?php

class Application_Form_SearchGensetForm extends Zend_Form
{
    private function getGenset()
    {
        $genset = new Application_Model_Genset();
        $result = $genset->getDataJoin();
        $gen = array();
        $gen[0] = '';
        foreach($result as $genset)
        {
            $gen[$genset['id_genset']] = $genset['serial_number_genset'];
        }
        
        return $gen;
        
    }
    
    public function init()
    {
        $genset = new Zend_Form_Element_Select('id_genset');
        $genset->setLabel('Serial Number Genset')->setMultiOptions($this->getGenset());
                
        $submit = new Zend_Form_Element_Submit('submitGenset');
        $submit->setLabel('Tambah Genset');
        
        $this->addElements(array($genset, $submit));
    }


}

